home *** CD-ROM | disk | FTP | other *** search
- /////////////////////////////////////////////////////////////////////
- // html macro ver 0.52
- // hidemaru macro "htmlmac2.mac"
- // saito-soft (saito tomonobu) 1995.10.24
- // Mail to: saito-to@jed.uec.ac.jp
-
- /////////////////////////////////////////////////////////////////////
- // path setting
- $macro_path = hidemarudir + "\\";
- // $macro_path = "c:\\user\\hmacro\\";
- $dic_path = hidemarudir + "\\";
- // $dic_path = "c:\\user\\hmacro\\";
-
- /////////////////////////////////////////////////////////////////////
- // start setting
- $callmenu = "main";
-
- /////////////////////////////////////////////////////////////////////
- // main
- Main:
- call MenuSub $callmenu;
- $comstr = $$return;
-
- // 属性情報取り出し
- call StrCut $comstr, 2;
- #action = val($$return);
-
- // 特殊処理
- if (#action == 0) {
- call StrCut $comstr, 3;
- $id = $$return;
- // はじめに
- if ($id == "start") {
- $title = input("タイトルを入力してください");
- if (result != no) {
- gofiletop;
- insert "<html>\n<head>\n<title>";
- insert $title + "</title>\n</head>\n<body>\n";
- gofileend;
- insert "\n</body>\n</html>\n";
- gofiletop;
- down 5;
- }
- }
- // 箇条書き
- if ($id == "kajyo") {
- execmacro $macro_path + "htmlkj.mac";
- endmacro;
- }
- }
- // サブメニュー呼び出し
- else if (#action == 1) {
- call StrCut $comstr, 3;
- $callmenu = $$return;
- goto Main;
- }
- // オプション無単独タグ
- else if (#action == 2) {
- call StrCut $comstr, 3;
- insert "<" + $$return + ">\n";
- endmacro;
- }
- // オプション無前後タグ
- else if (#action == 3) {
- call StrCut $comstr, 3;
- $top = "<" + $$return + ">";
- call StrCut $comstr, 4;
- $end = "<" + $$return + ">";
- if (selecting == true) {
- call SelectSub $top, $end;
- endmacro;
- }
- else {
- insertfix $top + $end;
- #len = strlen($top);
- right #len;
- endmacro;
- }
- }
- // オプション有単独タグ
- else if (#action == 4) {
- call StrCut $comstr, 3;
- $tag = $$return;
- call StrCut $comstr, 4;
- call OptionSub $$return;
- if ($$return != "") {
- insert "<" + $tag + $$return + ">\n";
- endmacro;
- }
- }
- // オプション有前後タグ
- else if (#action == 5) {
- call StrCut $comstr, 3;
- $tag = $$return;
- call StrCut $comstr, 4;
- $end = "<" + $$return + ">";
- call StrCut $comstr, 5;
- call OptionSub $$return;
- if ($$return != "") {
- $top = "<" + $tag + $$return + ">";
- if (selecting == true) {
- call SelectSub $top, $end;
- endmacro;
- }
- else {
- insertfix $top + $end;
- #len = strlen($top);
- right #len;
- endmacro;
- }
- }
- }
- // エラー
- else {
- message "エラーです";
- endmacro;
- }
-
- /////////////////////////////////////////////////////////////////////
- // end of macro
- endmacro;
-
- /////////////////////////////////////////////////////////////////////
- // menu sub
- MenuSub:
- $$dic = $dic_path + "htmlmenu.dic";
- ##menus = getininum($$dic, $$1, "num");
- ##i = 0;
- while (##i < ##menus) {
- $$base[##i] = getinistr($$dic, $$1, str(##i));
- call StrCut $$base[##i], 1;
- $$menu[##i] = $$return;
- ##i = ##i + 1;
- }
- menuarray $$menu, ##menus;
- if (result == no) endmacro;
- return $$base[result-1];
-
- /////////////////////////////////////////////////////////////////////
- // string cut sub (by :)
- StrCut:
- $$org = $$1;
- ##err = no;
- while (##2) {
- if ($$org == "") {
- ##err = yes;
- break;
- }
- ##colon = strstr($$org, ":");
- if (##colon == -1) {
- $$cut = $$org;
- $$org = "";
- }
- else {
- $$cut = leftstr($$org, ##colon);
- $$org = rightstr($$org, strlen($$org)-##colon-1);
- }
- ##2 = ##2 - 1;
- }
- if (##err) return "";
- return $$cut;
-
- /////////////////////////////////////////////////////////////////////
- // selecting insert sub
- SelectSub:
- escape;
- moveto selendx, selendy;
- insertfix $$2;
- moveto seltopx, seltopy;
- insertfix $$1;
- moveto selendx + strlen($$1 + $$2), selendy;
- return;
-
- /////////////////////////////////////////////////////////////////////
- // option making sub
- OptionSub:
- $$dic = $dic_path + "htmlopt.dic";
- ##opts = getininum($$dic, $$1, "num");
- ##i = 0;
- $$option = "";
- while (##i < ##opts) {
- $$base = getinistr($$dic, $$1, str(##i));
- call StrCut $$base, 1;
- $$mes = $$return;
- call StrCut $$base, 2;
- ##act = val($$return);
- call StrCut $$base, 3;
- $$tag = $$return;
-
- // 文字列及び数値
- if (##act == 0) {
- $$text = input($$mes);
- if (result != no)
- $$option = $$option + " " + $$tag + $$text;
- }
- // 引用符付き文字列
- if (##act == 1) {
- $$text = input($$mes);
- if (result != no)
- $$option = $$option + " " + $$tag + "\"" + $$text + "\"";
- }
- // 有無
- if (##act == 2) {
- question $$mes;
- if (result == yes)
- $$option = $$option + " " + $$tag;
- }
- // 選択
- if (##act == 3) {
- call StrCut $$base, 4;
- ##num = val($$return) + 1;
- ##j = 0;
- while (##j < ##num) {
- call StrCut $$base, 5 + ##j;
- $$menu[##j+1] = $$return;
- ##j = ##j +1;
- }
- $$menu[0] = $$mes;
- menuarray $$menu, ##num;
- if (result > 1)
- $$option = $$option + " " + $$tag + $$menu[result-1];
- }
- ##i = ##i + 1;
- }
- return $$option;
-